<template>
  <div>
    <div class="nav" :class="{ mobile: isMobile }">
      <p class="">什么都没有</p>
      <p class="line animation  ">We knew this wouldn't end well</p>
      <span class="btn-left  btn">开始阅读</span>
      <span class="btn-right btn">github</span>
    </div>
    <!--封面部分结束-->
    <!--文章主题部分开始-->
    <div class="main-content">
      <div class="card-list clearfix" :class="{ mobile: isMobile }">
        <div class="card">
          <div class="card-img-mark"></div>
          <img
            class="card-img "
            src="../../../assets/img/8.jpg"
            alt="Card image"
          />
          <div class="card-body">
            <h4 class="card-title">名称</h4>
            <p class="card-text">简介</p>
            <div class="card-time">
              <span class="iconfont icon-time"></span>
              <span>2020-10-10</span>
            </div>
            <div class="card-sort">
              <span class="iconfont icon-label"></span>
              <span>分类</span>
            </div>
            <div class="card-label">
              <button class="card-label-button"><a href="#">标签</a></button>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="card-img-mark"></div>
          <img
            class="card-img "
            src="../../../assets/img/A2.jpg"
            alt="Card image"
          />
          <div class="card-body">
            <h4 class="card-title">名称</h4>
            <p class="card-text">简介</p>
            <div class="card-time">
              <span class="iconfont icon-time"></span>
              <span>2020-10-10</span>
            </div>
            <div class="card-sort">
              <span class="iconfont icon-label"></span>
              <span>分类</span>
            </div>
            <div class="card-label">
              <button class="card-label-button"><a href="#">标签</a></button>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="card-img-mark"></div>
          <img
            class="card-img"
            src="../../../assets/img/LakePukaki_EN-AU9412206565_1920x1080.jpg"
            alt="Card image"
          />
          <div class="card-body">
            <h4 class="card-title">名称</h4>
            <p class="card-text">简介</p>
            <div class="card-time">
              <span class="iconfont icon-time"></span>
              <span>2020-10-10</span>
            </div>
            <div class="card-sort">
              <span class="iconfont icon-label"></span>
              <span>分类</span>
            </div>
            <div class="card-label">
              <button class="card-label-button"><a href="#">标签</a></button>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="card-img-mark"></div>
          <img
            class="card-img"
            src="../../../assets/img/8.jpg"
            alt="Card image"
          />
          <div class="card-body">
            <h4 class="card-title">名称</h4>
            <p class="card-text">简介</p>
            <div class="card-time">
              <span class="iconfont icon-time"></span>
              <span>2020-10-10</span>
            </div>
            <div class="card-sort">
              <span class="iconfont icon-label"></span>
              <span>分类</span>
            </div>
            <div class="card-label">
              <button class="card-label-button"><a href="#">标签</a></button>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="card-img-mark"></div>
          <img
            class="card-img "
            src="../../../assets/img/A2.jpg"
            alt="Card image"
          />
          <div class="card-body">
            <h4 class="card-title">名称</h4>
            <p class="card-text">简介</p>
            <div class="card-time">
              <span class="iconfont icon-time"></span>
              <span>2020-10-10</span>
            </div>
            <div class="card-sort">
              <span class="iconfont icon-label"></span>
              <span>分类</span>
            </div>
            <div class="card-label">
              <button class="card-label-button"><a href="#">标签</a></button>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="card-img-mark"></div>
          <img
            class="card-img "
            src="../../../assets/img/LakePukaki_EN-AU9412206565_1920x1080.jpg"
            alt="Card image"
          />
          <div class="card-body">
            <h4 class="card-title">名称</h4>
            <p class="card-text">简介</p>
            <div class="card-time">
              <span class="iconfont icon-time"></span>
              <span>2020-10-10</span>
            </div>
            <div class="card-sort">
              <span class="iconfont icon-label"></span>
              <span>分类</span>
            </div>
            <div class="card-label">
              <button class="card-label-button"><a href="#">标签</a></button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!--文章主题部分结束-->
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "index",
  computed: {
    ...mapGetters(["isMobile"])
  }
};
</script>

<style lang="less" scoped>
/*********** clearfix begin*************/
.clearfix:after {
  /*伪元素是行内元素 正常浏览器清除浮动方法*/
  content: "";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
.clearfix {
  *zoom: 1; /*ie6清除浮动的方式 *号只有IE6-IE7执行，其他浏览器不执行*/
}
/*********** clearfix end*************/
.nav {
  &mobile {
    .btn {
      left: 32vw;
      width: 150px;
      line-height: 50px;
      border-radius: 50px;
      color: white;
      background-color: transparent;
      position: absolute;
      border: 1px solid white;
      text-align: center;
    }
    .btn-right {
      top: 80vh;
    }
  }
  .btn {
    width: 150px;
    line-height: 50px;
    border-radius: 50px;
    top: 70vh;
    color: white;
    background-color: transparent;
    position: absolute;
    text-align: center;
    border: 1px solid white;
  }
  .btn-left {
    left: 30vw;
  }
  .btn-right {
    left: 60vw;
  }
  .btn:hover {
    color: white;
    background-color: skyblue;
    border: none;
  }
}
.main-content {
  width: 100%;
  padding: 0;
  margin: 0;
}
.card-list {
  width: 90vw;
  margin: 40px 10vw 0;
  &mobile {
    margin: 40px auto;
    width: 335px;
  }
}
.card {
  transition: all 0.35s ease-in-out;
  width: 335px;
  box-sizing: border-box;
  float: left;
  border-style: none;
  box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07) !important;
  border-radius: 8px;
  overflow: hidden;
  background-color: #ffffff;
  margin-bottom: 7vh;
  margin-right: 2vw;
  position: relative;
  .card-body {
    width: 100%;
  }
  .card-img-mark {
    position: absolute;
    height: 220px;
    width: 450px;
    background-color: rgba(0, 0, 0, 0.3);
  }
  .card-img {
    height: 220px;
    width: 450px;
    border-radius: 8px 8px 0 0;
    object-fit: cover;
  }
  .card-title {
    position: relative;
    margin-top: -75px;
    font-size: 24px;
    color: #ffffff;
    padding: 24px;
    font-weight: 300;
  }

  .card-text {
    font-size: 15px;
    padding-left: 30px;
    margin-top: -20px;
    margin-bottom: 10px;
  }
  .card-time {
    font-size: 13px;
    margin-left: 30px;
  }

  .card-sort {
    font-size: 13px;
    float: right;
    padding-right: 25px;
    margin-top: -17px;
  }

  .card-label {
    margin-top: 10px;
    background-color: inherit;
    border-top: 1px solid rgba(160, 160, 160, 0.2);
    position: relative;
    line-height: 40px;
    padding-left: 30px;
  }
  .card-label-button {
    background: -webkit-gradient(
      linear,
      0 100%,
      100% 100%,
      from(#6783af),
      to(#dae6e3)
    ); /** Chrome Safari **/
    background: -moz-linear-gradient(left, #6783af, #dae6e3); /** FireFox **/
    background: -o-linear-gradient(left, #6783af, #dae6e3); /** Opear **/
    background: -ms-linear-gradient(#6783af 0%, #dae6e3 100%); /** IE9 IE10 **/
    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#6783AF',endColorstr='#DAE6E3'); /** IE7 **/
    -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6783AF',endColorstr='#DAE6E3',gradientType=1); /** IE8 **/
    border-radius: 10px;
    text-decoration: none;
    border: none;
    font-size: 0.8rem;
    margin: 2px;
    font-weight: 400;
    height: 22px;
    line-height: 22px;
    color: #fff;
  }
  a {
    text-decoration: none;
    color: #ffffff;
    padding: 10px;
  }
}
.card:hover {
  animation: cardanimation 0.85s;
}
@keyframes cardanimation {
  50% {
    transform: scale(1.1, 1.1);
  }
  100% {
    transform: scale(1, 1);
  }
}
</style>
